#ifndef __CIRCLE_HULL_HANDLER_HPP__
#define __CIRCLE_HULL_HANDLER_HPP__

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include "QuadTreeOccupantHandler.hpp"

class CircleHullHandler : public QuadTreeOccupantHandler
{
public:
    ////////////////////////////////////////////////////////////
    /// Constructor
    ///
    ////////////////////////////////////////////////////////////
                            CircleHullHandler();
    ////////////////////////////////////////////////////////////
    /// Copy Constructor
    ///
    /// \param _Copy :      Handler to copy from
    ///
    ////////////////////////////////////////////////////////////
                            CircleHullHandler( const CircleHullHandler& _Copy );
    
    ////////////////////////////////////////////////////////////
    /// Init the handler from properties
    /// BaseObjectHandler::InitFromGrid need to be called AFTER the specialized class
    ///
    /// \param _pPropertyGrid :      Grid where infos are stored
    ///
    /// \return Whether the init was successful or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            InitFromGrid( wxPropertyGrid* _pPropertyGrid );
    
    ////////////////////////////////////////////////////////////
    /// Init the handler from an XMLElement
    /// BaseObjectHandler::InitFromXML need to be called AFTER the specialized class
    ///
    /// \param _pElement :           XML Element with info
    /// \param _ProjectPath :        Path to the project
    ///
    /// \return Whether the init was successful or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            InitFromXML( tinyxml2::XMLElement* _pElement, const wxString& _ProjectPath );
    
    ////////////////////////////////////////////////////////////
    /// Add the created object to the scene
    ///
    ////////////////////////////////////////////////////////////
    virtual void            AddObjectToScene();
    
    ////////////////////////////////////////////////////////////
    /// Remove the created object from the scene
    ///
    /// \param _bDeleteObject : Delete or not the object as well as removing it from the scene
    ///
    ////////////////////////////////////////////////////////////
    virtual void            RemoveObjectFromScene( bool _bDeleteObject = true );
    
    ////////////////////////////////////////////////////////////
    /// Return the value of a property
    ///
    /// \param _PropertyName :      Name of the property
    ///
    /// \return The value as a string
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        GetValueAsString( const wxString& _PropertyName ) const;
    
    ////////////////////////////////////////////////////////////
    /// Handle the change of a property and apply it to the object
    ///
    /// \param _pPropertyGrid :      The property grid
    /// \param _pChangedProperty :   Property that has been changed
    ///
    /// \return Whether the object has been changed or not
    ///
    ////////////////////////////////////////////////////////////
    virtual bool            OnPropertyChanged( wxPropertyGrid* _pPropertyGrid, wxPGProperty* _pChangedProperty );
    
    ////////////////////////////////////////////////////////////
    /// Get the name of the object handler
    ///
    /// \return the name of the object handler
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        GetName() const;

    CREATE_CLONE_FUNC(CircleHullHandler, BaseXMLObject)

protected:
    ////////////////////////////////////////////////////////////
    /// Create an XML string with the value of the object
    ///
    /// \param _ProjectPath :   Path to the project
    /// \param _Tab :           Tab string to have a beautiful XML
    ///
    /// \return the XML String
    ///
    ////////////////////////////////////////////////////////////
    virtual wxString        InnerXMLString( const wxString& _ProjectPath = wxEmptyString, const wxString& _Tab = wxT( "\t" ) ) const;
};

////////////////////////////////////////////////////////////
/// Get the name of the object handler
////////////////////////////////////////////////////////////
inline wxString CircleHullHandler::GetName() const {
    return "Circle Hull";
}

#endif // __CIRCLE_HULL_HANDLER_HPP__
